local locker = {}

locker.data = {
	-- [eventName] = {
	-- 	-- lockEvent = ,
	-- 	lockers = {
	-- 		"a" = true,
	-- 	}
	-- }
}

function locker.addLock(params)
	local eventName = params.eventName
	local lockEvent = params.lockEvent
	local lockerName = params.lockerName

	locker.data[eventName] = locker.data[eventName] or {}
	locker.data[eventName].lockEvent = lockEvent
	locker.data[eventName].lockers = locker.data[eventName].lockers or {}

	locker.data[eventName].lockers[lockerName] = true
end

function locker.releaseLock(params)
	local eventName = params.eventName
	local lockerName = params.lockerName

	if not locker.data[eventName] then
		return
	end

	if not locker.data[eventName].lockers then
		return
	end

	locker.data[eventName].lockers[lockerName] = false
end

function locker.isLock(params)
	local eventName = params.eventName
	if not locker.data[eventName] then
		return false
	end

	if not locker.data[eventName].lockers then
		return false
	end

	local isLock = false
	for k, v in pairs(locker.data[eventName].lockers) do
		if v then
			isLock = true
			break
		end
	end
	return isLock
end